package am.fp
{ 
  import flash.events.EventDispatcher;
  import flash.events.Event;
  
  /**
   * Main component events dispatcher.
   */
  public class FPDispatcher extends EventDispatcher 
  {
    private static var m_instance: FPDispatcher;
    
    public function FPDispatcher(enforcer: SingletonEnforcer)
    {
      if (enforcer == null)
        throw new Error("This class is a singleton so it can't be instantiated");
    }
    
    public static function get instance(): FPDispatcher
    {
      if (m_instance == null)
        m_instance = new FPDispatcher(new SingletonEnforcer);
      return m_instance;
    }
  }
}

class SingletonEnforcer{}
